import React from "react";

class App extends React.Component {
    /**
     *  类组件的状态数据 state
     *  1. 定义状态数据的第一种方式：在constructor构造函数中定义
     * 
     */
    constructor(){
        // 必须要先调用父类的构造函数
        super();
        this.state = {
            count:0
        }
    }
    render() {
        console.log('this: ', this);
        let {count} = this.state;
        return (
            <div>
                <h3>App</h3>
                <p>count: {this.state.count} - {count}</p>
            </div>
        )
    }
}
export default App;